package com.itheima.mapper.client;

import com.itheima.pojo.client.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * @author ChenJunJie
 * @date 2022/6/13 16:19
 * 收货地址的mapper层
 */
@Mapper
public interface AddressBookMapper {

    //新增地址
    int addAddress(AddressAddDto addressAdd);

    //查询地址
    List<SelectAddressVo> selectAddress (@Param("id") String id);

    //设置默认收货地址
    int updateDefaultAddress (UpdateDefaultAddressDto defaultAddressDto);

    //将所有地址改成普通地址
    int updateNotDefaultAddress();

    //查询默认收货地址
    SelectDefaultAddressVo selectDefaultAddress();

    //根据id获取收货地址
    SelectAddressByIdVo selectAddressById(@Param("id") String id);

    //修改收货地址
    int updateAddressById(UpdateAddressByIdDto updateAddressById);

    //删除收货地址
    int deleteAddressById(@Param("id") String id);
}
